#include <asm/asm.h>
#include <asm/regdef.h>
#include <cpu.h>
#include <asm/context.h>
#include <inst_ex_test.h>

####LEAF(n59_addi_ex_test)
    .globl n59_addi_ex_test
n59_addi_ex_test:
    .set noreorder
    li  a0, 0x3B
###test inst
    TEST_ADDI_EX(0x60a71e30, 0x7fff9b21, 0x000071db, 0x60a71e30)
    TEST_ADDI_EX(0x6c5392aa, 0x7ffff480, 0x000054b0, 0x6c5392aa)
    TEST_ADDI_EX(0xdeb06fd0, 0x7ffff84b, 0x00002c26, 0xdeb06fd0)
    TEST_ADDI_EX(0x9993b814, 0x7fffb280, 0x00005589, 0x9993b814)
    TEST_ADDI_EX(0x14132028, 0x7ffff860, 0x00001600, 0x14132028)
    TEST_ADDI_EX(0xa75f2d54, 0x7fffd84c, 0x00006f02, 0xa75f2d54)
    TEST_ADDI_EX(0x9a338000, 0x7fffcf88, 0x00007dc6, 0x9a338000)
    TEST_ADDI_EX(0x03a436e0, 0x7fffbf4c, 0x00005f10, 0x03a436e0)
    TEST_ADDI_EX(0xca6c3980, 0x7fffd9c4, 0x00003bd6, 0xca6c3980)
    TEST_ADDI_EX(0x487fcfe5, 0x7fffdd27, 0x00007208, 0x487fcfe5)
    TEST_ADDI_EX(0x22a23618, 0x7fffcf04, 0x00007ca0, 0x22a23618)
    TEST_ADDI_EX(0x42aa4389, 0x7ffff347, 0x000033c6, 0x42aa4389)
    TEST_ADDI_EX(0xcd908ee8, 0x7fffe660, 0x000025fa, 0xcd908ee8)
    TEST_ADDI_EX(0x1bc5574c, 0x7fffb580, 0x00006ce3, 0x1bc5574c)
    TEST_ADDI_EX(0xfa1cdcc0, 0x7ffffbdf, 0x00003228, 0xfa1cdcc0)
    TEST_ADDI_EX(0xd2169284, 0x7fffc624, 0x00003f46, 0xd2169284)
    TEST_ADDI_EX(0xfba95860, 0x7fffa558, 0x00007338, 0xfba95860)
    TEST_ADDI_EX(0xda0bca08, 0x7fff9b1f, 0x0000779a, 0xda0bca08)
    TEST_ADDI_EX(0x21feb84a, 0x7fffb6c8, 0x000058f3, 0x21feb84a)
    TEST_ADDI_EX(0x1d092948, 0x7ffffe85, 0x0000149b, 0x1d092948)
    TEST_ADDI_EX(0xce2f8cbc, 0x7ffff7ac, 0x00002ac4, 0xce2f8cbc)
    TEST_ADDI_EX(0xb2a90100, 0x7ffff808, 0x00007bb3, 0xb2a90100)
    TEST_ADDI_EX(0xdb92e3cc, 0x7fffc19e, 0x00006512, 0xdb92e3cc)
    TEST_ADDI_EX(0x51dccfe4, 0x7fffbc60, 0x00006ae7, 0x51dccfe4)
    TEST_ADDI_EX(0xda8fec00, 0x7fffccae, 0x00005a83, 0xda8fec00)
    TEST_ADDI_EX(0x06152570, 0x80003510, 0x0000baa6, 0x06152570)
    TEST_ADDI_EX(0xbd3ea700, 0x80004016, 0x000081f4, 0xbd3ea700)
    TEST_ADDI_EX(0x8f7ee6c0, 0x80002c93, 0x0000845d, 0x8f7ee6c0)
    TEST_ADDI_EX(0xe6075700, 0x80003a57, 0x0000be07, 0xe6075700)
    TEST_ADDI_EX(0x2909db2c, 0x800026f6, 0x0000a61a, 0x2909db2c)
    TEST_ADDI_EX(0x5d9751f4, 0x800021b6, 0x0000d072, 0x5d9751f4)
    TEST_ADDI_EX(0x7b83cc90, 0x80004287, 0x0000aca4, 0x7b83cc90)
    TEST_ADDI_EX(0xe36aedc6, 0x80004ca7, 0x000093c8, 0xe36aedc6)
    TEST_ADDI_EX(0x1971cf30, 0x80001c98, 0x0000d760, 0x1971cf30)
    TEST_ADDI_EX(0x150533d0, 0x80004d51, 0x00009438, 0x150533d0)
    TEST_ADDI_EX(0x9df31000, 0x800020e3, 0x0000ca64, 0x9df31000)
    TEST_ADDI_EX(0x9c3b3fa0, 0x80003338, 0x000080b2, 0x9c3b3fa0)
    TEST_ADDI_EX(0xeaaba458, 0x80003167, 0x0000a81a, 0xeaaba458)
    TEST_ADDI_EX(0x8c7b4880, 0x80001979, 0x0000cb8e, 0x8c7b4880)
    TEST_ADDI_EX(0xc94e5d40, 0x800039f2, 0x0000c570, 0xc94e5d40)
    TEST_ADDI_EX(0x88416d41, 0x80003e1b, 0x000094c0, 0x88416d41)
    TEST_ADDI_EX(0x93a6fc91, 0x800010fc, 0x0000d28c, 0x93a6fc91)
    TEST_ADDI_EX(0x5fd3eb1a, 0x8000243e, 0x0000ce06, 0x5fd3eb1a)
    TEST_ADDI_EX(0x9892cc38, 0x80001627, 0x0000e6b3, 0x9892cc38)
    TEST_ADDI_EX(0x58e7c636, 0x800021ae, 0x00009e80, 0x58e7c636)
    TEST_ADDI_EX(0x8704c78c, 0x8000536a, 0x00009617, 0x8704c78c)
    TEST_ADDI_EX(0xdf059448, 0x80001d9e, 0x0000a9ed, 0xdf059448)
    TEST_ADDI_EX(0xc56f0250, 0x80001228, 0x0000a3a3, 0xc56f0250)
    TEST_ADDI_EX(0x1e3cdc70, 0x80001806, 0x0000b09f, 0x1e3cdc70)
    TEST_ADDI_EX(0x5c2eb094, 0x800028a4, 0x00008a72, 0x5c2eb094)

###detect exception
###score ++
    addiu s3, s3, 1
###output a0|s3
inst_error:  
    sw s3, 0($23)
    sw a0, 0(s1)
    jr ra
    nop
####END(n59_addi_ex_test)
